﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Configuration;


namespace WCFService
{
    [RunInstaller(true)]
    public partial class ProjectInstaller : Installer
    {
        public ProjectInstaller()
        {
            InitializeComponent();

            string FileDir = System.Environment.CurrentDirectory;
            string FileName = System.IO.Path.Combine(@FileDir, @"xml\SysSet.xml");
            string strPort = Pub.Tools.XmlTools.Read(FileName, "SysSet/ServerPort");

            string serviceName = "WCFService" + strPort;

            Console.WriteLine("");
            Console.WriteLine("Install Dir : " + FileDir);
            Console.WriteLine("ServiceName : " + serviceName);
            Console.ReadLine();
            this.WCFserviceInstaller.DisplayName = strPort + " My WCF Service";
            this.WCFserviceInstaller.ServiceName = serviceName;

        }


    }
}
